<?php
/**
 * Created by PhpStorm.
 * User: t
 * Date: 2024/3/22
 * Time: 9:55
 */

namespace app\merchant\controller;

use app\home\model\HomeTemplate;
use app\Request;


class Template
{


    public function TemplateList()
    {
        $homeTemplateModel = new HomeTemplate();
        $data = $homeTemplateModel->select();
        return success('模板', $data);

    }

    public function upTemplate(Request $request)
    {
        $param = $request->param();
        $homeTemplateModel = new HomeTemplate();

        if ($param['status'] == 1) {
            $homeTemplateModel->where(['status' => 1])->update(['status' => 0]);
        }
        $homeTemplateModel->where(['id' => $param['id']])->update(['status' => $param['status']]);
        return success('修改成功');
    }
}